const path = require('path')

function resolve(dir) {
    return path.join(__dirname, dir)
}
module.exports = {
    // publicPath: process.env.NODE_ENV === 'production' ? '/production-sub-path/' : '/',
    devServer: {
        ///before 中间件
        // before: require('./mock/index.js')

        // before(app) {
        //     app.get('/api/courses', (req, res) => {
        //         res.json([{ name: 'web全栈', price: 8999 }, { name: 'web高级', price: 8999 }])
        //     })
        // }
    },
    configureWebpack: {
        // provide the app's title in webpack's name field, so that
        // it can be accessed in index.html to inject the correct title.
        resolve: {
            alias: {
                '@': resolve('src')
            }
        }
    },
    runtimeCompiler: true
}
